<?php

namespace App\Models\Concerns;

use App\Models\Order;
use App\Models\Panx\Product;
use App\Models\Youzan\YouzanAuthorizer;

/**
 * Interface YouzanAuthorizerable
 *
 * @property-read YouzanAuthorizer|null $youzanAuthorizer
 *
 * @package App\Models\Concerns
 */
interface YouzanAuthorizerable
{
    /**
     *  授权用户，自己的有赞商品
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany|Product
     */
    public function selfProducts();

    /**
     * 有赞商品，产生的订单
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany|Order
     */
    public function orders();

    /**
     * @used-by $youzanAuthorizer
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo|YouzanAuthorizer
     */
    public function youzanAuthorizer();
}
